package cs419.magnusmi.trackitcs;

/**
 * Created by Mikael Magnuson on 2/12/14.
 */
public class Item {

    //strings used for all variables because they are easier to maniuplate, and numeric
    //functionality can still be maintained for pages and id
    private String id;
    private String name;
    private String serial;
    private String pages;
    private String accessories;
    private String operatingSystem;
    private String specialFeatures;
    private String otherInfo;

    /**
     * default constructor
     * populates all attributes with values specified.
     * empty values get populated with "n/a"
     *
     * @param itemName name
     * @param itemSerial serial number
     * @param itemPages pages
     * @param itemAccessories accessories
     * @param itemOperatingSystem operatingSystem
     * @param itemSpecialFeatures special features
     * @param itemOtherInfo
     */
    public Item(String itemId, String itemName, String itemSerial, String itemPages, String itemAccessories,
                String itemOperatingSystem, String itemSpecialFeatures, String itemOtherInfo) {
        this.id = itemId;
        this.name = itemName;
        this.serial = itemSerial;
        this.pages = itemPages;
        this.accessories = itemAccessories;
        this.operatingSystem = itemOperatingSystem;
        this.specialFeatures = itemSpecialFeatures;
        this.otherInfo = itemOtherInfo;

        if (pages.length() == 0){
            pages = "0";
        }
        if (accessories.length() == 0){
            accessories = "N/A";
        }
        if (operatingSystem.length() == 0){
            operatingSystem = "N/A";
        }
        if (specialFeatures.length() == 0){
            specialFeatures = "N/A";
        }
        if (otherInfo.length() == 0){
            otherInfo = "N/A";
        }
    }

    /**
     *
     * @return
     */
    public String getId(){
        return id;
    }

    /**
     * Getter for name
     * @return
     */
    public String getName() {
        return name;
    }

    /**
     * Setter for name
     * @param newValue
     */
    public void setName(String newValue) {
        name = newValue;
    }

    /**
     * getter for accessories
     * @return
     */
    public String getAccessories() {
        return accessories;
    }

    /**
     * setter for accessories
     * @param accessories
     */
    public void setAccessories(String accessories) {
        this.accessories = accessories;
    }

    /**
     * getter for serial
     * @return
     */
    public String getSerial(){
        return serial;
    }

    /**
     * setter for serial
     * @param serial
     */
    public void setSerial(String serial){
        this.serial = serial;
    }




    /**
     * getter for pages
     * @return
     */
    public String getPages() {
        return pages;
    }

    /**
     * setter for pages
     * @param newValue
     */
    public void setPages(String newValue){
        pages = newValue;
    }

    /**
     * setter for OS
     * @return
     */
    public String getOperatingSystem(){
        return operatingSystem;
    }

    /**
     * getter for OS
     * @param newValue
     */
    public void setOperatingSystem(String newValue){
        operatingSystem = newValue;
    }

    /**
     * getter for spec. feat.
     * @return
     */
    public String getSpecialFeatures(){
        return specialFeatures;
    }

    /**
     * setter for spec. feat.
     * @param newSpecialFeatures
     */
    public void setSpecialFeatures(String newSpecialFeatures){
        specialFeatures = newSpecialFeatures;
    }

    /**
     * getter for other info
     * @return
     */
    public String getOtherInfo(){
        return otherInfo;
    }

    /**
     * setter for other info
     * @param newOtherInfo
     */
    public void setOtherInfo(String newOtherInfo){
        otherInfo = newOtherInfo;
    }
}
